package com.fjec.market.service;

import com.fjec.common.jxls.DataSixUpload;
import com.fjec.common.protocol.JsonResult;
import com.fjec.common.ys.protocol.ResRegister;
import com.fjec.common.ys.protocol.ResSearchReg;
import com.fjec.market.entity.InfoYsepayRegister;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 052.银盛支付注册表 服务类
 * </p>
 *
 * @author admin
 * @since 2020-10-30
 */
public interface IInfoYsepayRegisterService extends IService<InfoYsepayRegister> {

    /**
     * 保存个人进件信息
     *
     * @param custName
     * @param idCardNum
     * @param bankType
     * @param provMap
     * @param cityMap
     * @param countyMap
     * @param address
     * @param bankProvMap
     * @param bankCityMap
     * @param bankCountyMap
     * @param bankMap
     * @param bankCardNum
     * @param bankPhone
     * @param id102
     * @param url102
     * @param id103
     * @param url103
     * @param id104
     * @param url104
     * @param id105
     * @param url105
     * @param id106
     * @param url106
     * @param id107
     * @param url107
     * @param legalCertExpire 身份证有效期
     * @return
     */
    JsonResult savePersonalRegInfo(String custName, String idCardNum, String bankType,
                                   String provMap, String cityMap, String countyMap, String address,
                                   String bankProvMap, String bankCityMap, String bankCountyMap,
                                   String bankMap, String bankCardNum, String bankPhone,
                                   Long id102, String url102, Long id103, String url103,
                                   Long id104, String url104, Long id105, String url105,
                                   Long id106, String url106, String id107, String url107,
                                   String legalCertExpire
    );

    /**
     * 更新进件信息，仅在进件状态为进件失败（4）的时候可以修改
     *
     * @param id
     * @param custName
     * @param idCardNum
     * @param bankType
     * @param provMap
     * @param cityMap
     * @param countyMap
     * @param address
     * @param bankProvMap
     * @param bankCityMap
     * @param bankCountyMap
     * @param bankMap
     * @param bankCardNum
     * @param bankPhone
     * @param id102
     * @param url102
     * @param id103
     * @param url103
     * @param id104
     * @param url104
     * @param id105
     * @param url105
     * @param id106
     * @param url106
     * @param id107
     * @param url107
     * @param legalCertExpire 身份证有效期
     * @return
     */
    JsonResult updatePersonalRegInfo(Long id, String custName, String idCardNum, String bankType,
                                     String provMap, String cityMap, String countyMap, String address,
                                     String bankProvMap, String bankCityMap, String bankCountyMap,
                                     String bankMap, String bankCardNum, String bankPhone,
                                     Long id102, String url102, Long id103, String url103,
                                     Long id104, String url104, Long id105, String url105,
                                     Long id106, String url106, String id107, String url107,
                                     String legalCertExpire
    );

    /**
     * 保存公司进件信息
     *
     * @param custName
     * @param busLicense
     * @param busLicenseExpire
     * @param provMap
     * @param cityMap
     * @param countyMap
     * @param address
     * @param legalName
     * @param legalCertNo
     * @param legalTel
     * @param legalCertExpire
     * @param bankProvMap
     * @param bankCityMap
     * @param bankCountyMap
     * @param bankMap
     * @param bankType
     * @param bankCardNum
     * @param bankAccountName
     * @param certNo
     * @param bankPhone
     * @param id101
     * @param url101
     * @param id102
     * @param url102
     * @param id103
     * @param url103
     * @param id106
     * @param url106
     * @param id107
     * @param url107
     * @param id108
     * @param url108
     * @param samePerson
     * @return
     */
    JsonResult saveEntRegInfo(String custName, String busLicense, String busLicenseExpire,
                              String provMap, String cityMap, String countyMap, String address,
                              String legalName, String legalCertNo, String legalTel, String legalCertExpire,
                              String bankProvMap, String bankCityMap, String bankCountyMap,
                              String bankMap, String bankType, String bankCardNum,
                              String bankAccountName, String certNo, String bankPhone,
                              Long id101, String url101,
                              Long id102, String url102, Long id103, String url103,
                              Long id106, String url106, String id107, String url107,
                              Long id108, String url108, boolean samePerson
    );

    /**
     * 更新公司进件信息，仅在进件状态为进件失败（4）的时候可以修改
     *
     * @param id
     * @param custName
     * @param busLicense
     * @param busLicenseExpire
     * @param provMap
     * @param cityMap
     * @param countyMap
     * @param address
     * @param legalName
     * @param legalCertNo
     * @param legalTel
     * @param legalCertExpire
     * @param bankProvMap
     * @param bankCityMap
     * @param bankCountyMap
     * @param bankMap
     * @param bankType
     * @param bankCardNum
     * @param bankAccountName
     * @param certNo
     * @param bankPhone
     * @param id101
     * @param url101
     * @param id102
     * @param url102
     * @param id103
     * @param url103
     * @param id106
     * @param url106
     * @param id107
     * @param url107
     * @param id108
     * @param url108
     * @param samePerson
     * @return
     */
    JsonResult updateEntRegInfo(Long id, String custName, String busLicense, String busLicenseExpire,
                                String provMap, String cityMap, String countyMap, String address,
                                String legalName, String legalCertNo, String legalTel, String legalCertExpire,
                                String bankProvMap, String bankCityMap, String bankCountyMap,
                                String bankMap, String bankType, String bankCardNum,
                                String bankAccountName, String certNo, String bankPhone,
                                Long id101, String url101,
                                Long id102, String url102, Long id103, String url103,
                                Long id106, String url106, String id107, String url107,
                                Long id108, String url108, boolean samePerson
    );

    /**
     * 获取用户进件信息
     *
     * @param getType
     * @return
     * @throws Exception
     */
    JsonResult getYsRegInfo(Integer getType) throws Exception;

    /**
     * 查询用户进件状态
     *
     * @return
     */
    Map<String, Object> getYsRegStatus();

    /**
     * 进件
     *
     * @param id
     * @throws Exception
     */
    ResRegister ysReg(Long id) throws Exception;

    /**
     * 查询进件结果
     *
     * @param merchantNo
     * @return
     * @throws Exception
     */
    JsonResult searchYsReg(String merchantNo) throws Exception;

    ResSearchReg searchYsRegByMerchantNo(InfoYsepayRegister reg) throws Exception;

    // 发送线上进件失败 微信消息
    void sendOnlineYsRegFail(Long userId, String openId);

    // 发送线下进件成功 微信消息 for my boss
    void sendOfflineYsRegSuccess(Long userId, String openId);

    /**
     * @param limit
     * @param minutes
     * @return
     */
    List<Long> getEntityForReg(int limit, int minutes);

    void ysRegNotify(String usercode, String custname, String custid, String user_status, String cust_status, String merchant_no);

    byte[] generateContract(String type, String partyB, String phone, String legalName) throws Exception;

    /**
     * 获取一天的已经完成线上注册的信息
     *
     * @param dateTime
     * @return
     */
    List<Map<String, Object>> getOffLineRegList(String dateTime) throws Exception;

    /**
     * 更新线下进件状态
     *
     * @param dataList
     * @return
     */
    Map<String, Object> updateOffLineRegResult(List<DataSixUpload> dataList);

    /**
     * 查询指定RegStatus的列表数据
     * @return
     */
    List<InfoYsepayRegister> getEntityByRegStatus(Integer regStatus, int limit, int minutes);
}
